export default{
  namespaced:true,
  state:{
    isShowToast:false,
    toastMsg:'',
    toastType:''  //success danger warning
  },
  mutations:{
    changeIsShowToastMoadl(state,payload){
      state.isShowToast=payload.isshow;
      /* 如果为真，就进入   哪里有问题就改哪里，记得，兄弟*/
      if(payload.isshow){
        state.toastMsg=payload.msg;
        state.toastType=payload.type
      }
    }
  },
  //存放异步代码
  actions:{
    asyncChangeToast(context,payload){
      // console.log('asyncChangeToast')
      context.commit('changeIsShowToastMoadl',payload);
      setTimeout(() => {
        context.commit('changeIsShowToastMoadl',{
          isshow: false
        })
      }, 1500)
    }
  }
}